import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import router from "./router";
import * as ElementPlusIconsVue from "@element-plus/icons-vue"; // 图标
import "element-plus/theme-chalk/dark/css-vars.css";
import "@/css/index.css";
import i18n from "./lang";

import sizeObserver from "./directive/sizeObserver";

const pinia = createPinia();
const app = createApp(App);
// 中间件
app.use(router).use(pinia).use(i18n);
// element-plus 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.directive("size-ob", sizeObserver);

app.mount("#app");
